{
	template:`
	<a-page-header title="编辑" sub-title="汇总表列">
		<template #extra>
			<a-button type="primary" @click="save();">保存</a-button>
			<m-back @click="back(false);">关闭</m-back>
		</template>
		<a-card :hoverable="true" :bodyStyle="{padding:'20px 20px 0'}">
			<a-form class="index-form" :wrapper-col="{span:24}">
				<a-row :gutter="10">
					<a-col :span="8">
						<a-form-item label="标题" class="index-form-item">
                            <a-input v-model:value="model.title" placeholder="请输入标题"/>
						</a-form-item>
					</a-col>
					<a-col :span="16">
						<a-form-item label="标题组" class="index-form-item">
                            <a-tooltip title="可以为空, 多个用英文逗号分割">
                                <a-input v-model:value="model.groupTitle" placeholder="请输入标题组"/>
                            </a-tooltip>
						</a-form-item>
					</a-col>
					<a-col :span="8">
						<a-form-item label="别名" class="index-form-item">
                            <a-tooltip title="只能输入小写字母数字和下划线">
                                <a-input v-model:value="model.alias" placeholder="请输入别名"/>
                            </a-tooltip>
						</a-form-item>
					</a-col>
					<a-col :span="16">
						<a-form-item label="字段" class="index-form-item">
						    <a-button type="primary" @click="inputTestField()">输入</a-button>
                            {{model.field}}
						</a-form-item>
					</a-col>
					<a-col :span="8">
						<a-form-item label="类型" class="index-form-item">
                            <a-radio-group :options="dictOptions('api.model.ApiCollectColumn!type')" v-model:value="model.type" />
						</a-form-item>
					</a-col>
					<a-col :span="8">
						<a-form-item label="宽" class="index-form-item">
                            <a-input-number v-model:value="model.width" placeholder="请输入宽" style="width:100%"/>
						</a-form-item>
					</a-col>
					<a-col :span="8">
						<a-form-item label="排序" class="index-form-item">
                            <a-input-number v-model:value="model.sort" placeholder="请输入序号" style="width:100%"/>
						</a-form-item>
					</a-col>
					<a-col v-if="model.type=='NUMBER'" :span="8">
						<a-form-item label="数字格式" class="index-form-item">
                            <a-input v-model:value="model.numberFormat" placeholder="请输入数字格式"/>
						</a-form-item>
					</a-col>
					<a-col v-if="model.type=='NUMBER'" :span="16">
						<a-form-item label="汇总" class="index-form-item">
                            <a-radio-group :options="dictOptions('api.model.ApiCollectColumn!isCount')" v-model:value="model.isCount" />
						</a-form-item>
					</a-col>
					<a-col v-if="model.type=='STRING'" :span="8">
						<a-form-item label="最大行显" class="index-form-item">
                            <a-input-number v-model:value="model.lineClamp" placeholder="请输入最大行显" style="width:100%"/>
						</a-form-item>
					</a-col>
					<a-col v-if="model.type=='DATE'" :span="8">
						<a-form-item label="日期格式" class="index-form-item">
                            <a-input v-model:value="model.dateFormat" placeholder="请输入日期格式"/>
						</a-form-item>
					</a-col>
					<a-col v-if="model.type=='DATE'||model.type=='STRING'" :span="16">
						<a-form-item label="排序" class="index-form-item">
                            <a-radio-group :options="dictOptions('api.model.ApiCollectColumn!isOrder')" v-model:value="model.isOrder" />
						</a-form-item>
					</a-col>
					<a-col :span="8">
						<a-form-item label="默认显示" class="index-form-item">
                            <a-radio-group :options="dictOptions('api.model.ApiCollectColumn!isShow')" v-model:value="model.isShow" />
						</a-form-item>
					</a-col>
					<a-col :span="8">
						<a-form-item label="对齐" class="index-form-item">
                            <a-radio-group :options="dictOptions('api.model.ApiCollectColumn!textAlign')" v-model:value="model.textAlign" />
						</a-form-item>
					</a-col>
					<a-col v-if="model.type!='NUMBER'||model.isCount=='N'" :span="8">
						<a-form-item label="过滤" class="index-form-item">
                            <a-radio-group :options="dictOptions('api.model.ApiCollectColumn!isFilter')" v-model:value="model.isFilter" />
						</a-form-item>
					</a-col>
					<a-col v-if="model.type=='STRING'" :span="8">
						<a-form-item label="字典" class="index-form-item">
                            <a-tooltip>
                                <template #title>
                                    A:普通字典:填字典类型<br/>
                                    B:类属性:格式填(类全名!属性)<br/>
                                    C:类缓存列表:格式填(类全名:参数)或者(类全名) 参数根据缓存列表定义设置
                                </template>
                                <a-input v-model:value="model.dict" placeholder="请输入字典"/>
                            </a-tooltip>
						</a-form-item>
					</a-col>
				</a-row>
			</a-form>
		</a-card>
	</a-page-header>
	`,
	props: ['localeZh','param','parentVue'],
	data:function(){
		return {
		    model:{table:{}},

		};
	},
	mounted(){
	    this.model=this.param.model;
	},
	methods:{
		save:function(){
			this.requestData('action/api/apiCollect/doSaveColumn',
				{column:this.model},
				data=>{
					if(data.code==0){
						this.$message.success(data.msg);
						this.back(true);
					}else{
						this.$message.error(data.msg);
					}
				}
			);
		},
		inputTestField:function(){
            this.openPage('page/base/api/inputTestField.js',
                {value:this.model.field,collectOid:this.model.collect.oid,
                    temps:["#{字段}","DATE(#{字段})","SUM(#{字段})","SUM(case when #{字段}=#{字段} then #{字段} else 0 end)"]},
                function(flag,obj){
                    if(flag){
                        this.model.field=obj;
                    }
                },
                "800px"
            );
		}
	}
}